package project2011;
/**
 * Manages seller details  
 * @author Antone Gonzalez
 */
public class Seller {

    /**
     * Constructor makes a new Seller with passed in name, password and
     * accountNumber also initializes inventory
     * @param name the name of this seller
     * @param password the password of this seller
     * @param accountNumber the bankaccount number associated with this seller
     */
    public Seller(String name, String password, int accountNumber)
    {
        this.name = name;
        this.password = password;
        this.bankaccount = accountNumber;
        inventory = new ProductList();
    }
    /**
     * The accessor for this sellers name
     * @return String this sellers name
     */
    public String getName()
    {
        return name;
    }
    
    /**
     * Accessor for this sellers password
     * @return String this sellers password
     */
    public String getPassword()
    {
        return password;
    }
     /**
     * Accessor for this sellers bank account
     * @return int this account number
     */
    public int getAccountNumber()
    {
        return bankaccount;
    }
    /**
     * Adds passed in Product to this Sellers inventory
     * @param toAdd the Product to bed added this inventory
     */
    public void addProduct(Product toAdd)
    {
        inventory.addProduct(toAdd);
    }
    
    /**
     * prints the contents of this.seller
     * @return a string containing the contents of this.seller
     */
    public String print()
    {
        String result = name + ",";
        result += password + ",";
        result += bankaccount + ",";
        result += inventory.getSize() + ",\n";
        return result;
    }
    
    /**
     * Returns a string containing details of all products in inventory
     * @return a string containing details of all products in inventory
     */
    public String printInventory()
    {
        return inventory.print();
    }
    
    /**
     * accessor for inventory
     * @return this.inventory
     */
    public ProductList getInventory()
    {
        return inventory;
    }
    
    private String name;
    private String password;
    private int bankaccount;
    private ProductList inventory;
}
